home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / TOOLS / ASCDUMP.ZIP / ASCDUMP.DOC < prev    next >
Encoding:
Text File  |  1994-03-10  |  13.9 KB  |  380 lines

  1. ASCDUMP Btrieve File Dump Utility - Version 1.4a
  2.  
  3. AscDump will dump a Btrieve file using a BASIC TYPE..END TYPE definition 
  4. to define the field layout. It can download and upload ascii files 
  5. to/from Btrieve files, browse Btrieve files and generate XQL table 
  6. definitions for Btrieve files. 
  7.  
  8.  
  9. INSTALLATION
  10. ============
  11.  
  12. Unzip the ASCDMP.ZIP file which contains the following files :
  13.  
  14.         ASCDUMP.EXE - the program file
  15.         ASCDUMP.CFG - the program configuration file
  16.         ASCDUMP.DOC - this document
  17.  
  18. You should place the program and CFG files in a directory referenced by 
  19. your PATH if you want to be able to use the program in any directory. 
  20. Note that the CFG file only controls the screen colours and printer 
  21. destination, the program will proceed happily if it does not find the 
  22. .CFG file.
  23.  
  24.  
  25. INTERACTIVE USE
  26. ===============
  27.  
  28. To use AscDump interactively just enter the command ASCDUMP.
  29.  
  30. Dump a File
  31. -----------
  32.  
  33. Before you can dump a file you must provide :
  34.  
  35.         the name of the Btrieve datafile 
  36.         the name of the BASIC program file containing your TYPE definition
  37.         the name of the TYPE within that file
  38.         the name of the Output file
  39.  
  40. You must also decide whether you want to include a header line in the 
  41. output file. The header line will contain a comma delimited list of the 
  42. field names as the first line in the output file. This is useful if you 
  43. are loading the data into a spreadsheet as it gives each field a label. 
  44.  
  45. Note that if you leave the 'Name of TYPE Record' field blank the program 
  46. will show you a list of TYPE definitions from your source file for you 
  47. to pick the appropriate one.
  48.  
  49. You will finally be asked if you wish to dump all the fields. Normally 
  50. you will say yes, as the program cannot upload partial downloads. 
  51. However, if you want to take a subset of the fields for some other 
  52. purpose you can select the fields you want to download. You will be 
  53. shown a list of the fields, use the return key to mark/unmark the fields 
  54. to download and choose the "Proceed" option when you are done. Marked 
  55. fields are indicated by a tick-mark next to them.
  56.  
  57. A download may be aborted by pressing the ESCAPE key.
  58.  
  59. Load a File
  60. -----------
  61.  
  62. To load a file you must specify the same information as with the Dump 
  63. option with the following differences.
  64.  
  65. The ASCII file must exist and must contain comma delimited records 
  66. relating to the Btrieve File you are loading to.
  67.  
  68. Note that you can upload data to an existing file, if the program finds 
  69. a record that already exists it will update it with the data from the 
  70. ASCII files. It assumes that the first key defined in your Btrieve file 
  71. is the PRIMARY KEY and is unique. (See Limitations/Disclaimer)
  72.  
  73. An upload may be aborted by pressing the ESCAPE key.
  74.  
  75.  
  76. Browse a File
  77. -------------
  78.  
  79. Having specified a Btrieve File, and associated BASIC TYPE the Browse 
  80. option will display data from the file one record at a time. You can 
  81. step through the records with the next and previous options, or select a 
  82. record using the first index in the file. 
  83.  
  84. Control Characters in Strings (less than Ascii value 32) are displayed 
  85. as ascii values preceded by a backslash. eg. \002 for CHR$(2)
  86.  
  87. To modify data move the menu bar over the field you want to alter and 
  88. press return. You can then type in numeric or string data as 
  89. appropriate. Continue to modify fields in this way. When you have made 
  90. all the changes you MUST choose the "Update Record" option to save the 
  91. changes. Note that the program has no way of knowing whether the data 
  92. you have entered makes sense, so exercise care!
  93.  
  94. When selecting a record the program will pop up an input box containing 
  95. the fields from the first index in the file. You can type in the desired 
  96. key values at this point. The program does not look for an exact match, 
  97. but retrieves the first record that is Greater Than or Equal to your 
  98. input values.
  99.  
  100. If you have long string fields ( > 50 ) then you should not attempt to edit 
  101. them with this program.
  102.  
  103.  
  104. Update all Fields in a Btrieve File
  105. -----------------------------------
  106.  
  107. This option allows you to perform a "global update" on the data in a 
  108. Btrieve file. You can set fields to a constant value, or to the results 
  109. of an equation. You could use this to increase all prices by 10%, or set 
  110. a particular field to 0.
  111.  
  112. Note that this update effects ALL the records in the file, so be 
  113. careful!
  114.  
  115. After specifying the Btrieve file, Basic file and TYPE definition you 
  116. will be taken to a screen similar to the browse screen. Here you can 
  117. move the highlight bar down to the field(s) you are interested in. 
  118. Pressing Return lets you enter an equation for that field. Equations may 
  119. be in two forms. 
  120.  
  121. 1) A constant value, ie. 0, 65, 21.29 or -74. To enter a constant value, 
  122. just type the number you want to set the field to. Remember, this 
  123. effects every occurrence of that field in the Btrieve file. 
  124.  
  125. 2) An equation involving the current field (or others in the same 
  126. record). Several examples of this follow (you enter everything after 
  127. the equals sign) :
  128.  
  129.         PRICE     = PRICE * 1.10
  130.         TOTVAL    = QUANTITY * PRICE
  131.  
  132. In the examples above, TOTVAL, QUANTITY and PRICE are fields within the 
  133. TYPE definition for the Btrieve file. As each record is retrieved the 
  134. appropriate value is substituted for the field name and the equation 
  135. evaluated. The result is placed in the appropriate field.
  136.  
  137. For STRING fields you can set a field to a constant value or the value 
  138. of another field in the TYPE record. You cannot perform arithmetic on 
  139. STRINGS! Some examples follow :
  140.  
  141.         DELETEFLAG = N
  142.         FULLNAME   = SURNAME, TITLE FIRSTNAME
  143.         COMMENTS   = ""
  144.  
  145. You must not enclose the values in double or single quotes, with one 
  146. exception. If you wish to set a STRING field to be empty, you must enter 
  147. two double quotes as in the example for COMMENTS above. 
  148.  
  149. There is one special "field" that you can use in equations and that is 
  150. COUNT#. This will be replaced by the current record number, ie. 1 to n 
  151. where n is the number of records in the file. This may be useful if you 
  152. want to generate a unique sequence number for each record. To use it 
  153. just enter COUNT# in the equation just like a field name. A couple of 
  154. examples are shown :
  155.  
  156.         SEQNUM = COUNT#
  157.         SEQNUM = 10000 + COUNT#
  158.  
  159.  
  160. Global Update Warnings:
  161. -----------------------
  162.  
  163. You MUST NOT change any of the Primary Key values using this facility. 
  164. If you do so you could end up missing records out or even in an endless 
  165. loop.
  166.  
  167. There is no check on overflow when performing arithmetic on fields. 
  168.  
  169. You cannot perform arithmetic on string fields, although you can use 
  170. string fields in equations. However, if the string field does not 
  171. contain numerals then the results will be zero.
  172.  
  173.  
  174.  
  175. GENERATE XQL TABLE DEFINITION
  176. =============================
  177.  
  178. If you are using XQL this option conveniently generates the appropriate 
  179. XQL CREATE TABLE statements for the specified Btrieve file. If you are 
  180. generating a definition for the Btrieve file "CATANK.DB", this option 
  181. will generate two files, "CATANK.XQL" and "CATANK.LOD". The .XQL file 
  182. contains the CREATE TABLE statements while the .LOD file contains some 
  183. Basic INPUT# statements for each field in your Btrieve File. The .LOD 
  184. file can be used if you are writing a program to manipulate an Ascii 
  185. dump, it saves you writing a whole lot of INPUT# statements to read the 
  186. Ascii file. 
  187.  
  188.  
  189.  
  190. COMMAND LINE SWITCHES FOR INTERACTIVE USE:
  191. ==========================================
  192.  
  193. /50  will set your PC into 50 line on VGA adaptors. This is intended for 
  194.      use with the Browse option as it allows you to see more of your 
  195.      record. 
  196.  
  197. /MBF is an optional flag that you can use to access Btrieve files that have 
  198.      floating point numbers stored in Microsoft Binary Format (MBF). 
  199.      If you use this flag ALL floating point numbers will be treated as 
  200.      MBF numbers. 
  201.  
  202.      If all of your Btrieve files contain MBF numbers then you can place 
  203.      the line FLOAT=MBF in your ASCDUMP.CFG file. If you make this 
  204.      change, make sure that the ASCDUMP.CFG is in a directory pointed to 
  205.      by the PATH. 
  206.  
  207.  
  208. COMMAND LINE (BATCH) USE
  209. ========================
  210.  
  211. You can use ASCDUMP from the command line for automatic or unattended 
  212. downloads/uploads. It is most useful though with the /X flag as you can 
  213. create a batch file to generate XQL definitions for your entire database 
  214. rather than file-by-file. Any time you change your database you can 
  215. rerun this batch file.
  216.  
  217. The command line syntax is as follows
  218.  
  219. 1) to dump a file :
  220.  
  221.         ASCDUMP /D BtrieveFile BasicFile BasicTYPE OutPutFile N N [/MBF]
  222.  
  223. 2) to load a file from ascii to btrieve:
  224.  
  225.         ASCDUMP /R BtrieveFile BasicFile BasicTYPE OutPutFile N N [/MBF]
  226.  
  227. 3) to generate an XQL definition file :
  228.  
  229.         ASCDUMP /X BtrieveFile BasicFile BasicTYPE [/MBF]
  230.  
  231. 4) to enter browse mode on a btrieve file :
  232.  
  233.         ASCDUMP /B BtrieveFile BasicFile BasicTYPE [/MBF]
  234.  
  235. 5) to enter update mode on a btrieve file :
  236.  
  237.         ASCDUMP /U BtrieveFile BasicFile BasicTYPE [/MBF]
  238.  
  239.  
  240. Warning!
  241.  
  242. In command line mode minimal error checking is performed, so please be 
  243. careful that you have the parameters correct! (For dumping and loading 
  244. remember to specify N N as 5th and 6th parameters)
  245.  
  246. Note that the /MBF flag is optional, and if used should appear as the 
  247. last parameter.
  248.  
  249.  
  250.  
  251. LIMITATIONS/BUGS
  252. ================
  253.  
  254. While the program will cope with embedded TYPEs within a TYPE definition 
  255. it will not work with BC7.1 arrays in TYPES yet. You can define the 
  256. fields manually however!
  257.  
  258. If you pick a TYPE definition that does not match the Btrieve file then 
  259. the program will get confused and very likely do strange things. This 
  260. will only happen if the TYPE definition is the same length as the 
  261. Btrieve file record - but is still the wrong TYPE definition.
  262.  
  263. There is no support for variable length records.
  264.  
  265. Maximum Record Length supported is 2048 bytes.
  266.  
  267. There is no warning if you select an Output File that already exists, it 
  268. will happily write over it.
  269.  
  270. If you edit the ASCII file, be sure that you do not create extra blank 
  271. lines at the end of the file. If this happens the program will collapse 
  272. with an 'INPUT Past End' error when you reload it. The data will be 
  273. loaded correctly though - it is just messy.
  274.  
  275. You may have problems uploading data to an existing file if the first 
  276. index defined in the Btrieve file is not a unique index. The program 
  277. uses the first index to try and locate a record before inserting a new 
  278. one. If the first index is non-unique then the AscDump program will 
  279. repeatedly overwrite the first occurence of the index value.
  280.  
  281. When uploading data to a file, the file must already exist, ASCDUMP will 
  282. not create an empty file.
  283.  
  284. 'Print a Record' performs no checking to see if the printer is on line. 
  285. You can print to a file by changing the PRDEST= line in the ASCDUMP.CFG 
  286. file.
  287.  
  288. If you have indexed on part of a field then various options may not work 
  289. correctly. In particular the XQL table definition and Selecting Records 
  290. in Browse Mode. You can get around this by defining a different TYPE 
  291. which has the Partial key defined as a separate item. 
  292.  
  293. If you have defined a composite Btrieve key on several string fields the 
  294. program will cope with this. In the following example you have two 
  295. string fields, but have defined it to Btrieve as a String Index of 
  296. Length 8. The program can sort this out!
  297.  
  298. TYPE RJob
  299.         SectCode AS STRING * 4
  300.         JobCode AS STRING * 4
  301. END TYPE
  302.  
  303.  
  304.  
  305. DISCLAIMER
  306. ==========
  307.  
  308. This program was written for in-house use based on our own working 
  309. practices, in particular the first index of all our Btrieve files is a 
  310. Unique Index. While ASCDUMP works to good effect in this environment, 
  311. you may encounter problems with your setup/database design. To avoid 
  312. unpleasant discoveries I strongly urge you to take a backup of your 
  313. datafiles before using the upload feature (or altering records in 
  314. browse mode), particularly if you have a non-unique index as the first 
  315. index. 
  316.  
  317. User of this program acknowledges this disclaimer of warranty:
  318.  
  319. "This program is supplied as is.  The author disclaims all warranties, 
  320. expressed or implied, including, without limitation, the warranties of 
  321. merchantability and of fitness of this program for any purpose.  The 
  322. author assumes no liability for damages, direct or consequential, which 
  323. may result from the use of this program." 
  324.  
  325.  
  326. SUPPORT
  327. =======
  328.  
  329. For all questions, bug reports, comments and suggestions, please contact: 
  330.  
  331. Christopher Davies
  332. Ian Davies Graphics (UK) Ltd
  333. 242 Dover House Road
  334. Putney
  335. London SW15 5DA
  336.  
  337. Phone (+44) (81) 785 9257
  338. Compuserve: 100016,1164
  339.  
  340.  
  341. REGISTRATION
  342. ============
  343.  
  344. ASCDUMP is ShareWare.
  345.  
  346. You may make copies of this program and give them to others as long as 
  347. the documentation is provided with the program, both unaltered. 
  348.  
  349. If you like ASCDUMP, a registration fee of $25.00 would be appreciated.  
  350. The next version is free (plus S&H).  You will be able to receive 
  351. support by mail or CompuServe. 
  352.  
  353. Please include your name, address, and current version number. (The 
  354. version number may be found on the startup screen) See above for the 
  355. address. 
  356.  
  357.  
  358. HISTORY
  359. =======
  360.  
  361. 1.0     Orginal Release
  362.  
  363. 1.1     Added support for CURRENCY data type
  364.         Added support for files using MBF floating point numbers
  365.         Added command line support for Browse
  366.         Added 'Update ALL Records' facility
  367.         Added ASCDUMP.INI file to remember last interactive settings.
  368.  
  369. 1.1d    Minor Bug Fix for Browse mode (when entering BasicTYPE)
  370.         Minor Bug fix for MBF mode in configuration file
  371.  
  372. 1.2b    Expanded Buffer space to allow for records > 2048 bytes
  373.         Introduced support for arrays in TYPE definitions
  374.  
  375. 1.3     Skipped for administrative reasons!
  376.  
  377. 1.4a    Fixed problem with incorrectly selected field names in UPDATE 
  378.         ALL mode. 
  379.  
  380.